package com.aipartner.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * Chat History Entity
 * 
 * @author AI Partner Team
 * @since 2024-01-20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("chat_history")
public class ChatHistory {
    
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    
    @TableField("user_id")
    private Long userId;
    
    @TableField(exist = false)
    private String sessionId;
    
    @TableField("model_name")
    private String modelName;
    
    @TableField("function_category")
    private String functionType;
    
    @TableField("function_name")
    private String functionName;
    
    @TableField("user_message")
    private String userMessage;
    
    @TableField("ai_response")
    private String aiResponse;
    
    @TableField("token_used")
    private Integer tokensUsed;
    
    @TableField(exist = false)
    private Double cost;
    
    @TableField("processing_time")
    private Long responseTime;
    
    @TableField("status")
    private Integer status;
    
    @TableField(exist = false)
    private String errorMessage;
    
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}